package net.lab1024.sa.admin.module.business.exam.controller;

import net.lab1024.sa.admin.module.business.exam.domain.form.add.QuestionsaAddForm;
import net.lab1024.sa.admin.module.business.exam.domain.form.query.QuestionsaQueryForm;
import net.lab1024.sa.admin.module.business.exam.domain.form.update.QuestionsaUpdateForm;
import net.lab1024.sa.admin.module.business.exam.domain.vo.QuestionsaVO;
import net.lab1024.sa.admin.module.business.exam.service.QuestionsaService;
import net.lab1024.sa.base.common.domain.ValidateList;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import cn.dev33.satoken.annotation.SaCheckPermission;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.common.domain.PageResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 日历明细 Controller
 *
 * @Author AKITA
 * @Date 2025-06-06 11:11:41
 * @Copyright AKITA
 */

@RestController
@Tag(name = "日历明细")
public class QuestionsaController {

    @Resource
    private QuestionsaService questionsaService;


    @PostMapping("/questionsa/queryPage")
    public ResponseDTO<PageResult<QuestionsaVO>> queryPage(@RequestBody @Valid QuestionsaQueryForm queryForm) {
        return ResponseDTO.ok(questionsaService.queryPage(queryForm));
    }


    @PostMapping("/questionsa/add")
    public ResponseDTO<String> add(@RequestBody @Valid QuestionsaAddForm addForm) {
        return questionsaService.add(addForm);
    }

    @PostMapping("/questionsa/update")
    public ResponseDTO<String> update(@RequestBody @Valid QuestionsaUpdateForm updateForm) {
        return questionsaService.update(updateForm);
    }

    @PostMapping("/questionsa/batchDelete")
    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
        return questionsaService.batchDelete(idList);
    }


    @GetMapping("/questionsa/delete/{docEntry}")
    public ResponseDTO<String> batchDelete(@PathVariable Long docEntry) {
        return questionsaService.delete(docEntry);
    }
}
